CustomObjectWrapper
Abstract base class that wraps an object and exposes its properties and events through ICustomTypeDescriptor interface. Wrapped properties are read-only and can be displayed in PropertyGrid or similar controls. The wrapper also implements INotifyPropertyChanged to support data binding scenarios.
Erbt von: Disposable
Implementiert: INotifyPropertyChanged, ICustomTypeDescriptor
Konstruktoren
protected CustomObjectWrapper(T obj)
customObjectWrapper = CustomObjectWrapper(obj)
Abstract base class that wraps an object and exposes its properties and events through ICustomTypeDescriptor interface. Wrapped properties are read-only and can be displayed in PropertyGrid or similar controls. The wrapper also implements INotifyPropertyChanged to support data binding scenarios.
- obj
- The object to wrap.
Eigenschaften
Methoden
protected virtual IEnumerable<EventDescriptor> OnGetEvents()
result = customObjectWrapper.OnGetEvents()
Gets the event descriptors from the wrapped object.
Rückgabe: Collection of proxy event descriptors.
protected virtual IEnumerable<PropertyDescriptor> OnGetProperties()
result = customObjectWrapper.OnGetProperties()
Gets the property descriptors from the wrapped object.
Rückgabe: Collection of read-only proxy property descriptors.
protected virtual void OnPropertyChanged(string name)
customObjectWrapper.OnPropertyChanged(name)
Call PropertyChanged event.
- name
- Member name.
public override string ToString()
result = customObjectWrapper.ToString()
Returns a string representation of the tuple, with values separated by commas.
Rückgabe: A string representing the tuple's values.
Ereignisse
public event PropertyChangedEventHandler PropertyChanged
customObjectWrapper.PropertyChanged += handler
PropertyChanged.